"""lx_apitest URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path

from api_test.view_tools import zhengjiao, zhengjiao_play, zhengjiao_excel
from api_test.views import *

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r"^login/$", login, name='login'),  # 登录

    re_path(r"^register/$", register, name='register'),  # 注册

    re_path(r"^welcome/$", welcome, name='welcome'),  # 基础页

    re_path(r"^case_list/$", case_list, name='case_list'),  # 用例

    re_path(r"^home/$", home, name='home'),  # 主页

    re_path(r"^$",home),
    # re_path(r"^accounts/login/$",login),  # 非登录状态跳回登录页面

    # re_path(r"^child/(?P<eid>.+)/(?P<oid>.*)", child, name='child'),

    re_path(r"^child/(?P<eid>.+)/(?P<oid>.*)/(?P<ooid>.*)/$", child, name='child'),

    re_path(r"^logout/$", logout, name='logout'),  # 退出

    re_path(r"^pei/$", pei, name='pei'),  # 吐槽

    re_path(r"^help/$", api_help, name='api_help'),  # 帮助

    re_path(r"^gateway/$", gateway, name='gateway'),  # 传送门

    re_path(r"^tools/$", tools),  # 小工具集合

    re_path(r"^make_random/$", make_random),  # 生成随机数

    re_path(r"^project_list/$", project_list, name='project_list'),  # 项目列表

    re_path(r"^delete_project/$", delete_project),  # 删除项目

    re_path(r"^add_project/$", add_project),  # 新增项目

    re_path(r"^apis/(?P<id>.*)/$", open_apis),  # 进入接口库

    re_path(r"^cases/(?P<id>.*)/$", open_cases),  # 进入大用例库

    re_path(r"^project_set/(?P<id>.*)/$", open_project_set),  # 进入接口库

    re_path(r"^save_project_set/(?P<id>.*)/$", save_project_set),  # 保存项目设置

    re_path(r"^project_api_add/(?P<Pid>.*)/$", project_api_add),  # 新增接口

    re_path(r"^project_api_del/(?P<id>.*)/$", project_api_del),  # 删除接口

    re_path(r"^save_bz/$", save_bz),  # 保存备注

    re_path(r"^get_bz/$", get_bz),  # 获取备注

    re_path(r"^Api_save/$", Api_save),  # 保存调试接口数据

    re_path(r"^get_api_data/$", get_api_data),  # 显示调试窗口获取数据

    re_path(r"^Api_send/$", Api_send),  # 发送调试请求

    re_path(r"^copy_api/$", copy_api),  # 复制接口

    re_path(r"error_request/$", error_request),  # 异常值请求



    re_path(r"^get_api_log_home/$", get_api_log_home),  # 左侧边栏a 标签获取请求数据

    re_path(r"^home_log/(?P<log_id>.*)/$", home),  # 再次进入首页!!!!!!!!!!!

    re_path(r"^add_case/(?P<eid>.*)/$", add_case),  # 新增大用例

    re_path(r"^del_case/(?P<eid>.*)/(?P<oid>.*)/$", del_case),  # 删除大用例

    re_path(r"^copy_case/(?P<eid>.*)/(?P<oid>.*)/$", copy_case),  # 复制大用例

    re_path(r"^get_small/$", get_small),  # 获取小用例数据

    re_path(r"^mock/(.*)/$", mock),  # mock 功能

    re_path(r"^user_upload/", user_upload),  # 上传头像

    re_path(r"^add_new_step/$", add_new_step),  # 新增小用例步骤

    re_path(r"^delete_step/(?P<eid>.*)/$", delete_step),  # 删除小用例步骤

    re_path(r"^get_step/$", get_step),  # 小用例步骤数据获取

    re_path(r"^save_step/$", save_step),  # 保存小用例步骤

    re_path(r"^step_get_api/$", step_get_api),  # select 框获取数据

    re_path(r"^Run_Case/$", Run_Case),  # 运行大用例

    re_path(r"^look_report/(?P<eid>.*)/$", look_report),  # 查看报告

    re_path(r"^upload_fd/(?P<Pid>.*)/$", upload_fd),  # fiddler 文件上传

    re_path(r"^save_project_header/$", save_project_header),  # 保存全局请求头

    re_path(r"^save_case_name/$", save_case_name),  # 保存用例名

    re_path(r"^save_project_host/$", save_project_host),  # 保存全局域名

    # ---------------登录态---------------#
    re_path(r"project_get_login/$", project_get_login),  # 获取登录态接口

    re_path(r"project_login_save/$", project_login_save),  # 保存项目登录态接口

    re_path(r"project_login_send/$", project_login_send),  # 调试请求登录态接口



    # ---------------正交小工具---------------#
    re_path(r"^tools_zhengjiao/$", zhengjiao),

    re_path(r"zhengjiao_play/$", zhengjiao_play),

    re_path(r"zhengjiao_excel/$", zhengjiao_excel),

    # ---------------首页---------------#
    re_path(r"^Home_save_api/$", Home_save_api),  # 保存首页调试请求

    re_path(r"^Api_send_home/$", Api_send_home),  # 首页调试

    re_path(r"^get_home_log/$", get_home_log),  # 获取主页请求记录

    re_path(r'^search/$',search), # 主页搜索

    # ---------------json对比---------------#
    re_path(r"^tools_json/$",tools_json),  # json长字符串对比页面

    re_path(r"^compare_json/$",compare_json), # json对比

    # ---------------全局变量---------------#
    re_path(r"^global_data/(?P<id>.*)/$",global_data),

]
